﻿<?xml version="1.0" encoding="utf-8"?>
<!--
        作者：          liuleyi
        更新时间：      20170227
        用途：          生成存储过程默认模板
-->
<xsl:stylesheet version="2.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:fn="http://www.w3.org/2005/xpath-functions">
	<xsl:output method="text" indent="no" encoding="utf-8" byte-order-mark="no"/>  
	<xsl:template match="/">
	<xsl:result-document encoding="utf-8" method="text" href="./generate/python/urls.py">
	<xsl:variable name="StringTypeDefine" select="document('../model/0101_StringTypeDefine.xml')"/>
	<xsl:variable name="EnumTypeDefine" select="document('../model/0102_EnumTypeDefine.xml')"/>
	<xsl:variable name="BooleanTypeDefine" select="document('../model/0103_BooleanTypeDefine.xml')"/>
	<xsl:variable name="DateTypeDefine" select="document('../model/0104_DateTypeDefine.xml')"/>
	<xsl:variable name="NumberTypeDefine" select="document('../model/0105_NumberTypeDefine.xml')"/>
	<xsl:variable name="IntegerTypeDefine" select="document('../model/0106_IntegerTypeDefine.xml')"/>#-*- encoding:UTF-8 -*-
from django.conf.urls import url
from . import views
app_name = 'polls'

urlpatterns = [
#主页
    url(r'^$', views.index, name='index'),
    url(r'^index/$', views.index, name='index'),
    url(r'^top/$', views.top, name='top'),
    url(r'^menu/$', views.menu, name='menu'),
    url(r'^main/$', views.main, name='main'),
    url(r'^login/$', views.login, name='login'),
<xsl:for-each select="FunNoConfig/FunNo">
#<xsl:value-of select="@label"/>
    url(r'^<xsl:value-of select="@code"/>/<xsl:for-each select="Request"><xsl:for-each select="Column">(?P&lt;<xsl:value-of select="@name"/>&gt;.*)/</xsl:for-each><xsl:for-each select="Field">(?P&lt;<xsl:value-of select="@name"/>&gt;.*)/</xsl:for-each></xsl:for-each>$', views.<xsl:value-of select="@code"/>, name='<xsl:value-of select="@code"/>'),
</xsl:for-each>
<xsl:for-each select="FunNoConfig/GoNo">
    url(r'^<xsl:value-of select="@code"/>/$', views.<xsl:value-of select="@code"/>, name='<xsl:value-of select="@code"/>'),
</xsl:for-each>
]

</xsl:result-document></xsl:template>  
</xsl:stylesheet>